<template>
        <div class="mui-numbox" data-numbox-step='1' data-numbox-min='1'>
            <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
            <input class="mui-numbox-input" type="number" @change="updatenum" ref='numbox' :value='number'/>
            <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
        </div>   
</template>
<script>
import mui from '../../lib/mui/js/mui.min.js'
export default {
    data(){
        return{
            // value:1
        }
    },
    mounted(){
        mui(".mui-numbox").numbox()
        
        
    },
    methods:{
        updatenum(){
            this.$store.commit('updatedata',{id:this.id,count:this.$refs.numbox.value,type:'count'})
        }
    },
    props:["number","id"],
    // watch:{
    //     max:function(newvalue,oldvalue){
    //         this.max = newvalue;
    //         mui(".mui-numbox").numbox().setOption('max',this.max)
    //         // console.log(this.max)
    //     }
    // }
    
}
</script>
<style lang="scss" scoped>

</style>
